home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 May / macformat-024.iso / Shareware City / Developers / BoxMaker++ / BoxMaker++ ƒ / outfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-20  |  663 b   |  35 lines  |  [TEXT/KAHL]

  1. #pragma once
  2. //
  3. // This is a hack. The constructor creates and opens a file,
  4. // which must then be retrieved by calling operator(). There
  5. // is no destructor. The client application is supposed to
  6. // close the file itself.
  7. //
  8. class outfile
  9. {
  10.     public:
  11.     
  12.         outfile( unsigned char *postfix, OSType inWhichFolder = 'desk');
  13.  
  14.         short operator()() const;
  15.         long  vRefNum() const;
  16.  
  17.     private:
  18.         FSSpec theFile;
  19.         short fileno;
  20.  
  21.         static void set2chars( const int n, unsigned char *two_chars);
  22.         
  23.         static void makeprefix( Str31 thename);
  24. };
  25.  
  26. inline short outfile::operator()() const
  27. {
  28.     return fileno;
  29. }
  30.  
  31. inline long  outfile::vRefNum() const
  32. {
  33.     return theFile.vRefNum;
  34. }
  35.